package sk.tramtatiri.data.dataobjects;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
public class UserSport extends DomainObject{

	private static final long serialVersionUID = 6278287051253020895L;
	
	@Id
	@GeneratedValue
	private long id;

//	private long userId;
//	private long sportId;
	
	private Long user_id;
	private Long sport_id;
	
	@ManyToOne
	@JoinColumn(name="user_id",insertable=false,updatable=false,referencedColumnName="id")
	private User user;
	
	@ManyToOne
	@JoinColumn(name="sport_id",insertable=false,updatable=false,referencedColumnName="id")
	private Sport sport;
	
	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	private Date date;
	private int duration; // float ak v hodinach
	private int totalCalories;
	
	public UserSport() {
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	/**
	 * @return the totalCalories
	 */
	public int getTotalCalories() {
		return totalCalories;
	}

	/**
	 * @param totalCalories the totalCalories to set
	 */
	public void setTotalCalories(int totalCalories) {
		this.totalCalories = totalCalories;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @return the sport
	 */
	public Sport getSport() {
		return sport;
	}

	/**
	 * @param sport the sport to set
	 */
	public void setSport(Sport sport) {
		this.sport = sport;
	}

	public Long getUser_id() {
		return user_id;
	}

	public void setUser_id(Long user_id) {
		this.user_id = user_id;
	}

	public Long getSport_id() {
		return sport_id;
	}

	public void setSport_id(Long sport_id) {
		this.sport_id = sport_id;
	}

//	/**
//	 * @return the userId
//	 */
//	public long getUserId() {
//		return userId;
//	}
//
//	/**
//	 * @param userId the userId to set
//	 */
//	public void setUserId(long userId) {
//		this.userId = userId;
//	}
//
//	/**
//	 * @return the sportId
//	 */
//	public long getSportId() {
//		return sportId;
//	}
//
//	/**
//	 * @param sportId the sportId to set
//	 */
//	public void setSportId(long sportId) {
//		this.sportId = sportId;
//	}
}
